package com.sunjob.mroexecute.controller;

import com.sunjob.common.domain.execute.User;
import com.sunjob.common.result.Result;
import com.sunjob.mroexecute.service.Faultasstesservice;
import com.sunjob.mroexecute.service.Faultresumeservice;
import com.sunjob.mroexecute.service.Faulttechservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : 曾波
 * @Create :2022-8-10-10:34
 */
@RestController

public class FaultController {
    @Autowired
    Faultasstesservice faultasstesservice;
    @Autowired
    Faulttechservice faulttechservice;
    @Autowired
    Faultresumeservice faultresumeservice;
    //加载初始车辆信息
    @RequestMapping("/zhixing")//具体路径待改
    public User zhixin(User user){
        return user;
    }

    //根据车id查询车详细信息
    @RequestMapping("/Viewvehicleinformation1")
        public Result carinformation(@RequestParam("id") String id){
        long a =Integer.parseInt(id);
               Result instance = faultasstesservice.selectInstanceById(a);

                return  instance;
    }

    //根据构型id查询修成工艺
    @RequestMapping("/Checkrepairprocess1")
    public Result repairprocess(@RequestParam("id") String id){
        long a =Integer.parseInt(id);

               Result result = faulttechservice.getRepairProcess2ById(a);
        return  result;
    }

    //查看车维修履历
    @RequestMapping("/Maintenancehistoryview1")
    public Result viewmaintenancehistory(@RequestParam("id") String id){
        long a =Integer.parseInt(id);

//        Result result = faultresumeservice.get(a);
        return  null;
    }

    //提交维修报告
    @RequestMapping("/Assetfeedback1")
    public Result Assetfeedback1(@RequestParam("obj") String obj){



        return  null;
    }
}
